//
//  WBUserAccountViewModel.h
//  WeiBoOC
//
//  Created by 韩菲菲 on 16/8/11.
//  Copyright © 2016年 韩菲菲. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WBUserAccount.h"

@interface WBUserAccountViewModel : NSObject

//防止重复操作沙盒
@property (nonatomic , strong) WBUserAccount *userAccount;

//用户的accesstoken
@property (nonatomic , copy) NSString *accessToken;

//判断用户是否登录
@property (nonatomic , assign) BOOL isLogin;

//给外界提供接口 请求数据
//请求code 只需要告诉控制器 是否请求成功就可以了
//单例设计
+ (instancetype)sharedWBUserAccountViewModel;

//请求数据 只需要告诉控制器请求失败还是成功就可以了
- (void)getUserTokenWithCode:(NSString *)code andFinishedBlock:(void(^)(BOOL isSuccess))finishBlock;

//根据token请求个人信息
- (void)getUserInfoWithUserAccount:(WBUserAccount *)userAccount andFinishedBlock:(void(^)(BOOL isSuccess))finishBlock;

- (void)saveUserAccount:(WBUserAccount *)userAccount;

- (WBUserAccount *)getUserAccount;

@end
